package com.sh.data.engine.web.webapi.controller.index;


import com.sh.data.engine.common.util.DateUtil;
import com.sh.data.engine.web.webapi.controller.base.response.RestResponseEntity;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * 用于快速测试应用启动情况的Controller
 *
 * @author: mengzheng.mhc
 * @date: 2024/5/23 14:27
 */
@Tag(name = "其他", description = "非业务API")
@RestController
@RequestMapping("/index")
public class IndexController {

    @Operation(summary = "健康检查", description = "应用健康检查")
    @ApiResponse(responseCode = "200", description = "应用状态正常")
    @GetMapping("/check")
    public RestResponseEntity<String> check() {
        String result = "服务健康，现在时间：" + DateUtil.formatDate(new Date());
        return RestResponseEntity.success(result);
    }

}
